﻿<%@ Page Title="Parts - Deposit" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Deposit.aspx.cs" Inherits="VSM.Parts.Deposit" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function OpenItemPopup() {
            var url = "../../../ItemPartPopup.aspx?itmgrp=102";
            Main.openCustomDialog(url, 600, 610, "Parts List");
        }
        function OpenWhs(whsType, title) {
            var url = "../../../WhsPopup.aspx?id=" + whsType;
            Main.openCustomDialog(url, 600, 610, title);
        }
        function OpenBP() {
            var url = "../../../BPPopup.aspx?CardType=C";
            Main.openCustomDialog(url, 600, 610, "Business Partner List");
        }
        function OpenDocList(docktype, title) {
            var url = "../../../DocumentList.aspx?DocType=" + docktype
            Main.openCustomDialog(url, 800, 610, title);
        }
        function OpenActiveList() {
            var url = "DepositActivitesList.aspx"
            Main.openCustomDialog(url, 800, 610, "Activities List");
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="hdnMasterID" runat="server" />
                <h2>
                    &nbsp;<asp:Label ID="lblTitle" runat="server" Text="Parts - Deposit"></asp:Label>
                </h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table border="0" width="100%" style="background-color: #D1D4D8; font-weight: bold;">
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                <asp:Label ID="lblCustomerInfo" runat="server" Text="Customer:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCustomerCode" runat="server" BackColor="#E6E6E6" ReadOnly="True"
                                    Width="96px"></asp:TextBox>
                                <asp:TextBox ID="txtCustomerName" runat="server" Width="250px"></asp:TextBox>
                                <asp:Button ID="btnSelectBP" runat="server" OnClientClick="OpenBP(); return false;"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                    font-weight: bold" Text="..." Width="30px" />
                            </td>
                            <td align="right"> <asp:Button ID="btnActiveList" runat="server" OnClientClick="OpenActiveList(); return false;"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                    font-weight: bold" Text="Activities List" Width="100px" /></td>
                        </tr>
                    </table>
                    <table id="Table2" width="100%" style="font-weight: bold">
                        <tr>
                            <td class="FormLineItemAlt" valign="middle" colspan="2">
                                <asp:Button ID="btnAddItems" runat="server" Text="Add new item" Style="background-image: url('/Images/bgButton.png');
                                    background-repeat: no-repeat;" BorderStyle="Solid" Width="110px" OnClick="btnAddItems_Click" />
                            </td>
                        </tr>
                    </table>
                    <hr />
                    <div style="width: 100%">
                        <asp:GridView ID="grvWTQ1" CssClass="GridInner" runat="server" Width="50%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px" OnRowCreated="grvWTQ1_RowCreated" CellSpacing="2" OnRowEditing="EditItem"
                            OnRowUpdating="UpdateItem" HeaderStyle-VerticalAlign="Middle" OnRowCancelingEdit="CancelEdit"
                            AllowPaging="True" OnPageIndexChanging="grvWTQ1_PageIndexChanging" PageSize="20"
                            OnRowDeleting="DeleteItem" OnRowDataBound="grvWTQ1_RowDataBound">
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="30px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                            <Columns>
                                <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="70px" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" TabIndex="-1" OnClick="lnkDelete_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="40px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblNo" runat="server" Text='<%# Bind("No") %>' BorderStyle="none" />
                                        <asp:HiddenField ID="hdnDetailID" runat="server" Value='<%# Bind("ID") %>' />
                                        <asp:HiddenField ID="hdnHeaderID" runat="server" Value='<%# Bind("HeaderID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Amount">
                                    <ItemStyle HorizontalAlign="Center" Width="100px" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtDepositAmt" runat="server" Style="text-align: right;" Text='<%# Bind("DepositAmt") %>'
                                            BorderStyle="none" Enabled="false" OnTextChanged="txtDepositAmt_OnTextChanged" AutoPostBack="true"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="Limt">
                                    <ItemStyle HorizontalAlign="Center" Width="100px" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtDepositLimit" runat="server" Style="text-align: right;" Text='<%# Bind("DepositLimit") %>'
                                            BorderStyle="none" Enabled="false" ></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Date">
                                    <ItemStyle HorizontalAlign="Center"  Width="200px"/>
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtDepositDate" runat="server" Style="text-align: center;" Text='<%# Bind("DepositDate") %>'
                                            BorderStyle="none" Enabled="false" OnTextChanged="txtDepositDate_OnTextChanged" AutoPostBack="true" />
                                        <asp:ImageButton ID="imgDeldate" runat="Server" AlternateText="Click to show calendar"
                                            ImageUrl="~/Images/Calendar_scheduleHS.png" Enabled="false" />
                                        <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDepositDate"
                                            PopupButtonID="imgDeldate" Format="dd/MM/yyyy">
                                        </cc1:CalendarExtender>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Active">
                                    <ItemStyle HorizontalAlign="Center" />
                                    <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                    <ItemTemplate>
                                        <asp:RadioButton ID="chkActive" runat="server" GroupName="Active" OnCheckedChanged="chkActive_OnCheckedChanged" AutoPostBack="true" Checked='<%# Eval("IsActive").ToString().Equals("True") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False" Height="27px"
                                VerticalAlign="Middle" HorizontalAlign="Center"/>
                            <EmptyDataTemplate>
                                <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                    cellspacing="2" cellpadding="2">
                                    <tr valign="middle" style="height: 27px; color: white; text-decoration: none; background-color: rgb(96, 149, 201);text-align:center;">
                                        <th>
                                            <span>Action</span>
                                        </th>
                                        <th>
                                            <span>#</span>
                                        </th>
                                        <th>
                                            <span>Amount</span>
                                        </th>
                                        <th>
                                            <span>Date</span>
                                        </th>
                                        <th>
                                            <span>Active</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td colspan="9">
                                            <span style="vertical-align: middle;">No Data</span>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </div>
                    <hr width="100%" />
                </div>
                <table width="100%" border="0">
                    <tr>
                        <td valign="top" style="width: 50%;">
                            <table>
                                <tr>
                                    <td style="width: 20%;">
                                        <strong>Remarks:</strong>
                                    </td>
                                    <td style="width: 80%;">
                                        <asp:TextBox runat="server" ID="txtRemarks" Height="71px" Width="208%" TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div style="margin-left: 5px; width: 99%;">
                                <hr />
                            </div>
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 250px;">
                                        <asp:Button ID="btnSave" runat="server" Text="Save" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" OnClick="btnSave_Click" BorderStyle="Solid"
                                            Width="60px" />
                                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" BorderStyle="Solid" OnClick="btnCancel_Click"
                                            Width="60px" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
